<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>删除词汇</title>
<link href="../../../theme/style.css" rel="stylesheet" type="text/css" />
<script src="../../../theme/jquery.js" type="text/javascript"></script>
<script src="../../../theme/wscui.js" type="text/javascript"></script>
<script src="../../../theme/style.js" type="text/javascript"></script>
</head>
<body>
<div catalog-feed class="grammar">
	<h1>del</h1>
	<label class="format">
		<span class="t">array</span> <span class="f">del</span>(
			<span class="t">int</span>/<span class="t">string</span> <span class="v">$param</span>
		)
	</label>
	<div class="intro">
		将分词词典中的词汇删除，
		一经删除，
		指定词汇在分词时将被忽略（不作为一个词出现）；
		默认状态，分词词典记录在MySQL数据库的cws_dict表中；
		删除时，如果使用的不是MySQL词典，
		系统将按配置自动更新Redis、XDB词典。
		<div class="br"></div>
		源文：服装和服饰<br />
		结果：服装、和服、服饰
		<div class="br"></div>
		假设：删除"和服"词汇, 新结果将如下<br />
		结果：服装、服饰
	</div>
	<div class="return">
		<div>
			<span show>null</span>
			<label>指定词汇不存在</label>
			<div hide class="how">
				<span class="t">return</span> <span class="f">null</span>;
			</div>
		</div>
		<div>
			<span show>array</span>
			<label>成功删除</label>
			<div hide class="how">
				<pre><span class="t">return</span> <span class="f">array</span>(
	<span class="k">id</span> 			=> <span class="i">222872</span>, 					<span class="c">// 主键编号</span>
	<span class="k">hash</span> 		=> <span class="s">1e24cf708a14ce81</span>, 		<span class="c">// 词汇MD5码的中间16个字符</span>
	<span class="k">word</span> 		=> <span class="s">测试</span>, 					<span class="c">// 词汇内容</span>
	<span class="k">weight</span> 	=> <span class="i">4.720000</span>, 				<span class="c">// 权重基数</span>
	<span class="k">attr</span> 		=> <span class="s">vn</span> 						<span class="c">// 词汇词性</span>
);</pre>
			</div>
		</div>
	</div>
	<div class="param">
		<h3>$param</h3>
		<ul>
			<li>
				<span show>int</span>
				<label>按主键id删除</label>
				<div hide class="how">
					<span class="f">M</span>(<span class="s">cws</span>) -> <span class="f">del</span>(<span class="i">1</span>);
				</div>
			</li>
			<li>
				<span show>string</span>
				<label>删除指定词汇</label>
				<div hide class="how">
					<span class="f">M</span>(<span class="s">cws</span>) -> <span class="f">del</span>(<span class="s">测试</span>);
				</div>
			</li>
		</ul>
	</div>
</div>
</body>
</html>